home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DELPHI32 / GRAPHICS / IMGLIB95 / UMULTIM.PA_ / UMULTIM.PA
Text File  |  1996-03-31  |  3KB  |  131 lines

  1. {
  2. Written by Jan Dekkers and Kevin Adams (c) 1995, 1996. If you are a non
  3. registered client, you may use or alter this demo only for evaluation
  4. purposes.
  5.  
  6. Copyright by SkyLine Tools. All rights reserved.
  7.  
  8. Part of Imagelib VCL/DLL Library.
  9. }
  10.  
  11. unit umultim;
  12.  
  13. {Includes settings to compile in either 16 or 32 bit}
  14. {$I DEFILIB.INC}
  15.  
  16. interface
  17.  
  18. uses
  19. {$IFDEF DEL32}
  20.   Windows,
  21. {$ELSE}
  22.   WinTypes,
  23.   WinProcs,
  24. {$ENDIF}
  25.   DLL95V1,    {ImageLib Dll interface and misc. functions}
  26.   Messages,
  27.   SysUtils,
  28.   Classes,
  29.   Graphics,
  30.   Controls,
  31.   Forms,
  32.   Dialogs,
  33.   StdCtrls,
  34.   Buttons,
  35.   MImaTB,    {PMultiMedia Toolbar VCL component}
  36.   TMultiMP;  {PMultiMedia VCL component}
  37.  
  38.  
  39. type
  40.   TMMForm3 = class(TForm)
  41.     Label1: TLabel;
  42.     CheckBox1: TCheckBox;
  43.     PMultiMedia1: TPMultiMedia;
  44.     MultiMediaToolbar1: TMultiMediaToolbar;
  45.     Label2: TLabel;
  46.     Label3: TLabel;
  47.     Label4: TLabel;
  48.     procedure CheckBox1Click(Sender: TObject);
  49.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  50.     procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
  51.       Shift: TShiftState; X, Y: Integer);
  52.     procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  53.       Y: Integer);
  54.     procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
  55.       Shift: TShiftState; X, Y: Integer);
  56.     procedure FormActivate(Sender: TObject);
  57.     procedure FormCreate(Sender: TObject);
  58.   private
  59.     { Private declarations }
  60.     MoveImage  :  boolean;
  61.   public
  62.     { Public declarations }
  63.   end;
  64.  
  65. var
  66.   MMForm3: TMMForm3;
  67.  
  68. implementation
  69.  
  70. {$R *.DFM}
  71. {------------------------------------------------------------------------}
  72.  
  73. procedure TMMForm3.CheckBox1Click(Sender: TObject);
  74. begin
  75.    {Show or hide the toolbar}
  76.    MultiMediaToolbar1.ShowToolBar:=CheckBox1.Checked;
  77. end;
  78. {------------------------------------------------------------------------}
  79.  
  80. procedure TMMForm3.FormClose(Sender: TObject; var Action: TCloseAction);
  81. begin
  82.    MMForm3:=Nil;
  83.    Action:=caFree;
  84. end;
  85. {------------------------------------------------------------------------}
  86.  
  87. procedure TMMForm3.FormMouseDown(Sender: TObject; Button: TMouseButton;
  88.   Shift: TShiftState; X, Y: Integer);
  89. begin
  90.    {If the shift key is down the image can be moved}
  91.    if ssShift in Shift then
  92.      MoveImage:=true
  93.    else
  94.      MoveImage:=false;
  95. end;
  96. {------------------------------------------------------------------------}
  97.  
  98. procedure TMMForm3.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  99.   Y: Integer);
  100. begin
  101. {In case moveimage is true (Shift key down) move the Image}
  102.  if MoveImage then begin
  103.     PMultiMedia1.Top:=Y;
  104.     PMultiMedia1.Left:=X;
  105.  end;
  106.     Label2.Caption:='X ='+IntToStr(X)+'   Y ='+IntToStr(Y);
  107. end;
  108. {------------------------------------------------------------------------}
  109.  
  110. procedure TMMForm3.FormMouseUp(Sender: TObject; Button: TMouseButton;
  111.   Shift: TShiftState; X, Y: Integer);
  112. begin
  113.     {Reset the moveimage indicater}
  114.     MoveImage:=false;
  115. end;
  116. {------------------------------------------------------------------------}
  117.  
  118. procedure TMMForm3.FormActivate(Sender: TObject);
  119. begin
  120.   {On activate show the toolbar}
  121.   MultiMediaToolbar1.ShowToolBar:=true;
  122. end;
  123. {------------------------------------------------------------------------}
  124.  
  125. procedure TMMForm3.FormCreate(Sender: TObject);
  126. begin
  127.   MultiMediaToolbar1.PreviewsDir:=ExtractFilePath(Application.Exename);
  128. end;
  129.  
  130. End.
  131.